home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-03
/
iqb9107.zip
/
CANCELIT.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-06-27
|
1KB
|
43 lines
' CancelIt.BAS
' Demonstration of the PRINT spooler CANCEL operation
' $INCLUDE: 'QB.BI'
' Declare the variables needed for spool operations
DIM SpoolFile AS STRING * 64
DIM InRegs AS RegType, OutRegs AS RegType
' Check to see if the PRINT.COM spooler is loaded
InRegs.AX = &H100 ' spooler load residency request
Interrupt &H2F, InRegs, InRegs
AL = InRegs.AX MOD 256
IF AL = 0 THEN
PRINT "PRINT is not loaded."
END
END IF
' Ask the user for the name of a file to cancel
LINE INPUT "Enter the filename to cancel >", FileName$
IF LEN(FileName$) = 0 THEN END ' nothing to do, so exit
SpoolFile = LTRIM$(RTRIM$(UCASE$(FileName$))) + CHR$(0)
' Cancel the file
InRegs.AX = &H102
InRegs.DX = VARPTR(SpoolFile)
Interrupt &H2F, InRegs, OutRegs
' Isolate the status of the cancel operation
CanceledOK% = NOT OutRegs.flags AND 1
IF CanceledOK% THEN
PRINT FileName$; " has been canceled from the queue."
ELSE
AL = OutRegs.AX MOD 256
PRINT "Could not cancel "; FileName$; " error code is "; AL
END IF
END